﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class InOutInvDetail2RptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlConsigneeID;
        protected DropDownList ddlDescr;
        protected DropDownList ddlExportDeclarationID;
        protected DropDownList ddlImportDeclarationID;
        protected DropDownList ddlItemNoID;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReceiptID;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlVendorIDOper;
        protected HtmlForm F15345;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img1;
        protected HtmlImage imgOwnerID;
        protected Label Label1;
        protected Label lblConsigneeID;
        protected Label lblDescr;
        protected Label lblEndDateTime;
        protected Label lblExportDeclarationID;
        protected Label lblImportDeclarationID;
        protected Label lblMsg;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected Label lblReceiptID;
        protected Label lblSkuID;
        protected Label lblStartDateTime;
        protected Label lblVendorID;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtConsigneeID;
        protected TextBox txtDescr;
        protected TextBox txtEndDateTime;
        protected TextBox txtExportDeclarationID;
        protected TextBox txtImportDeclarationID;
        protected TextBox txtItemNoID;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;
        protected TextBox txtReceiptID;
        protected TextBox txtSkuID;
        protected TextBox txtStartDateTime;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("InOutInvDetail2RptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlDescr, 0);
            base.InitQueryDDL(this.ddlVendorIDOper, 0);
            base.InitQueryDDL(this.ddlConsigneeID, 0);
            base.InitQueryDDL(this.ddlReceiptID, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlItemNoID, 0);
            base.InitQueryDDL(this.ddlImportDeclarationID, 0);
            base.InitQueryDDL(this.ddlExportDeclarationID, 0);
            base.SetDefaultOwner(this.txtOwnerID);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string ConsigneeID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtConsigneeID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtConsigneeID.Text.Trim(), this.ddlConsigneeID.SelectedValue);
                }
                return "";
            }
        }

        public string Descr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtDescr.Text.Trim(), this.ddlDescr.SelectedValue);
                }
                return "";
            }
        }

        public string EndTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndDateTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndDateTime.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "9999-12-31 23:59:59";
            }
        }

        public string ExportDeclarationID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExportDeclarationID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExportDeclarationID.Text.Trim(), this.ddlExportDeclarationID.SelectedValue);
                }
                return "";
            }
        }

        public string ImportDeclarationID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtImportDeclarationID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtImportDeclarationID.Text.Trim(), this.ddlImportDeclarationID.SelectedValue);
                }
                return "";
            }
        }

        public string ItemNoID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtItemNoID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtItemNoID.Text.Trim(), this.ddlItemNoID.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string StartTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStartDateTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtStartDateTime.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "2000-01-01 00:00:00";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorIDOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

